import "@/styles/globals.css";
import "antd/dist/reset.css";
import {PropsWithChildren, useEffect, useState} from "react";

// import {wrapper} from "@/store/index";

function App({Component, pageProps}: any) {
    const [mounted, setMounted] = useState(false);

    // useEffect only runs on the client, so now we can safely show the UI
    useEffect(() => {
        setMounted(true);
    }, []);

    
    const Layout = Component.layout || (({children}: {children: any}) => <>{children}</>);

    // 设置页面加载中
    if (!mounted) {
        // use your loading page
        return (
            <div className="hidden">
                <Layout>
                    <Component {...pageProps} />
                </Layout>
            </div>
        );
    }

    return (
        <Layout>
            <Component {...pageProps} />
        </Layout>
    );
}

export default App;
// export default wrapper.withRedux(App);
